<script setup>
import { ref, onMounted } from 'vue';
import AppItem from './components/AppItem.vue';

const itemRef = ref();

onMounted(() => {
    console.log(itemRef.value);
    console.log(itemRef.value.title);
    itemRef.value.updateTitle();
})

</script>

<template>
    <div>
        <!-- 这个地方是ref，而不是`:ref` -->
        <AppItem ref="itemRef"></AppItem>
    </div>
</template>